package cl.xintec.utils
{
	import mx.core.Application;
	import mx.controls.Alert;
	
	public class Webservice10
	{


		//private static var URI_BASE:String = "http://172.27.10.73:7777/seap/";

		// private static var URI_BASE:String = "http://joule:7131/cfl/";
		private static var URI_BASE:String = "http://110.1.36.68:9001/AdministracionWS/";
		//private static var URI_BASE:String = "http://localhost:7001/AdministracionWS/";
		 
		// private static var URI_BASE:String = "http://joule:8301/dad/";
		 	
		 private static var URI_REPORTE:String = "http://localhost:7080/";	




		
		public function Webservice10()
		{
		}

		public static function getServiceURL(wservice:String):String {
			var baseURL:String;
			baseURL = Application.application.url;
			var pattern1:RegExp = new RegExp("http://[^/]*/[^/]*/*");
			if (pattern1.test(baseURL) == true) {
				return pattern1.exec(baseURL).toString().concat("services/" + wservice);
			} else{
				return URI_BASE + "services/" + wservice;
			}
		}

		public static function getURL(wservice:String):String {
			var baseURL:String;
			baseURL = Application.application.url;
			var pattern1:RegExp = new RegExp("http://[^/]*/[^/]*/*");
			if (pattern1.test(baseURL) == true) {
				return pattern1.exec(baseURL).toString().concat(wservice);
			} else{
				return URI_BASE + wservice;
			}
		}

		public static function getReporteURL(wservice:String):String {
			var baseURL:String;
			baseURL = Application.application.url;
			var pattern1:RegExp = new RegExp("http://[^/]*/[^/]*/*");
			if (pattern1.test(baseURL) == true) {
				return pattern1.exec(baseURL).toString().concat("../"+wservice);
			} else{
				return URI_REPORTE + wservice;
			}
		}
	}
}
